package com.deng.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.deng.entity.Usermessage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.deng.vo.UserMessageVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author dengwenxiong
 * @since 2021-05-05
 */
@Mapper
@Repository
public interface UsermessageMapper extends BaseMapper<Usermessage> {

    IPage<UserMessageVo> selectMessages(Page page, @Param(Constants.WRAPPER)QueryWrapper<Usermessage> wrapper);
    @Update("update usermessage set status=1 ${ew.customSqlSegment}")
    void updateToReaded(@Param(Constants.WRAPPER)QueryWrapper<Usermessage> id);
}
